package com.sun.androidexerciseproject.widget.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.sun.androidexerciseproject.widget.util.LogUtil;

/**
 * Created by Steven on 2016/9/20 0020.
 */

public abstract class BaseActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutId());
        initViews();
        LogUtil.log(this.getClass().getSimpleName() + " onCreate!!!");
    }

    @Override
    protected void onStart() {
        super.onStart();
        LogUtil.log(this.getClass().getSimpleName() + " onStart!!!");
    }

    @Override
    protected void onStop() {
        super.onStop();
        LogUtil.log(this.getClass().getSimpleName() + " onStop!!!");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        LogUtil.log(this.getClass().getSimpleName() + " onDestroy!!!");
    }

    public abstract int getLayoutId();

    public abstract void initViews();
}
